/**
 * @file ClearMode.cpp
 *
 * @date 17/12/2011
 * @author Tales 
 *
 */

#include "InfoMode.hpp"
#include <string>

namespace yep
{
InfoMode::InfoMode()
{
}

pair<string, InfoMode::Function> InfoMode::getNextLine(Editor & editor)
{
	if (lines.empty())
	{
		return make_pair(string(""), END);
	}
	else
	{
		auto ret = lines.front();
		lines.pop();
		return ret;
	}
}

void InfoMode::handleAnswer(Editor & editor, string answer)
{
}

void InfoMode::setup()
{
	ConsoleModeBase::setup();
	while (!lines.empty())
	{
		lines.pop();
	}
	lines.push(make_pair(string(8, '#'), NO_FUNCTION));
	lines.push(make_pair("# INFO #", NO_FUNCTION));
	lines.push(make_pair(string(8, '#'), NO_FUNCTION));

	lines.push(make_pair(" ", NO_FUNCTION));
	lines.push(make_pair("YepPainter (c) 2011 Tales Miranda", NO_FUNCTION));
	lines.push(make_pair("Licença MIT license, veja README para mais informações", NO_FUNCTION));

	lines.push(make_pair(" ", NO_FUNCTION));
	lines.push(make_pair(string(9, '#'), NO_FUNCTION));
	lines.push(make_pair("# AJUDA #", NO_FUNCTION));
	lines.push(make_pair(string(9, '#'), NO_FUNCTION));

	lines.push(make_pair(" ", NO_FUNCTION));
	lines.push(make_pair("Todos os comandos a seguir funcionam apenas em modo de desenho:", NO_FUNCTION));
	lines.push(make_pair("F1           - Esta ajuda", NO_FUNCTION));
	lines.push(make_pair("F2           - Nova imagem", NO_FUNCTION));
	lines.push(make_pair("F3           - Escolher Cor", NO_FUNCTION));
	lines.push(make_pair("F4           - Escolher Ferramenta", NO_FUNCTION));
	lines.push(make_pair("F5           - Escolher Camada", NO_FUNCTION));
	lines.push(make_pair("F6           - Gerenciar Camadas", NO_FUNCTION));
	lines.push(make_pair("F7           - Abrir/Salvar", NO_FUNCTION));
	lines.push(make_pair("Ctrl-Z       - Desfazer ultima ação", NO_FUNCTION));
	lines.push(make_pair("Ctrl-Shift-Z - Refazer ultima ação", NO_FUNCTION));

	lines.push(make_pair(" ", NO_FUNCTION));
	lines.push(make_pair(string("Pressione qualquer tecla para voltar..."), PAUSE));
}

/* namespace yep */
}

